@extends('admin.common.app')
@section('cont')
    <section class="Hui-article-box">
        <nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页
            <span class="c-gray en">&gt;</span>文章管理
            <span class="c-gray en">&gt;</span>添加分类
            <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px"
               href="javascript:location.replace(location.href);" title="刷新">
                <i class="Hui-iconfont">&#xe68f;</i>
            </a>
        </nav>
        <article class="cl pd-20">
            @include('admin.common.msg')
            <form action="{{ route('admin.classify.store') }}" method="post" class="form form-horizontal">
                @csrf
                <div class="row cl">
                    <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>分类名称：</label>
                    <div class="formControls col-xs-8 col-sm-9">
                        <input type="text" class="input-text"  placeholder="请输入分类名称" name="name"
                               autocomplete="off">
                    </div>
                </div>
                <div class="row cl">
                    <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
                        <input class="btn btn-primary radius" type="submit" value="添加分类">
                    </div>
                </div>
            </form>
        </article>
    </section>
@endsection
@section('js')
    <script type="text/javascript" src="/admin/lib/jquery.validation/1.14.0/jquery.validate.js"></script>
    <script type="text/javascript" src="/admin/lib/jquery.validation/1.14.0/validate-methods.js"></script>
    <script type="text/javascript" src="/admin/lib/jquery.validation/1.14.0/messages_zh.js"></script>
    <script type="text/javascript">
        //验证为实现
        $(function(){
            $('.skin-minimal input').iCheck({
                checkboxClass: 'icheckbox-blue',
                radioClass: 'iradio-blue',
                increaseArea: '20%'
            });

            $("#form-horizontal").validate({
                rules:{
                    name:{
                        required:true,
                    },
                },
                onkeyup:false,
                success:"valid",
                submitHandler: function (form) {
                    // 表单提交
                    form.submit();
                }
            });
        });
    </script>

@endsection
